// 1、定义一个用户的切片
import { createSlice } from '@reduxjs/toolkit'
const urlSlice = createSlice({
    name: 'url',
    initialState: {
        urlIndex: '/zin/information'
    },
    reducers: { //定义的都是函数，对initialState里面的数据进行修改

        handleUrlIndex(state, action) {
            state.urlIndex = action.payload
        }
    }
})
// 对生成的action 和reduce进行导出
export const { handleUrlIndex } = urlSlice.actions //导出reducers里面的函数
export default urlSlice.reducer
